home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / bbs / pad321.zip / USER.MH < prev    next >
Text File  |  1996-08-21  |  1KB  |  48 lines

  1. // (C) 1995 Stefan Xenos
  2. //
  3. // This file contains various functions for manipulating the user list.
  4. //
  5. // Function list:
  6. //
  7. // long         findPhone       (long: startIdx, Ref struct _usr: u, string: dataPhone, string: voicePhone)
  8. //
  9. // void         userInit        ();
  10. // bool         userToken       (string: token, string: params);
  11. //
  12.  
  13. #ifndef __USER_MH
  14. #define __USER_MH
  15.  
  16. #ifndef __STRIPNUM_MH
  17. #include "stripnum.mh"
  18. #endif
  19.  
  20. long findPhone (long: idx, Ref struct _usr: u, string: dataPhone, string: voicePhone) {
  21.   long: size;
  22.   string: tempData, tempVoice;
  23.  
  24.   stripNonNumeric (dataPhone);
  25.   stripNonNumeric (voicePhone);
  26.  
  27.   size := userfilesize ();
  28.  
  29.   for (;idx < size; idx := idx + 1) {
  30.  
  31.     userfindseek (idx, u);
  32.  
  33.     tempData := u.dataphone;
  34.     tempVoice := u.phone;
  35.  
  36.     stripNonNumeric (tempData);
  37.     stripNonNumeric (tempVoice);
  38.  
  39.     if (((voicePhone <> "") and (voicePhone = tempVoice))
  40.       or ((dataPhone <> "") and (dataPhone = tempData))) {
  41.       return idx;
  42.       };
  43.     };
  44.   return -1;
  45.   }
  46.  
  47. #endif
  48.